{% extends  'nav_base.html' %}
{% load  static %}
{% load  recent_reply %}
{% load theme_to_reply %}
{% load  all_node_theme %}

{% block  left_content %}
    <div class="panel panel-default">
        <div class="panel-body panel-subtitle">

            <span class="label label-success">按最新时间排序</span>

              <span class="pull-right ordering">
                  <strong>排序规则:</strong>
                <span>
                  <a href="/page/1">最新时间</a>
                </span>
                <span>
                  <a href="#">最新回复</a>
                </span>
              </span>

        </div>
        <!-- List group -->
        <ul class="list-group topic-list">
        {% if topics.top %}
            <li class="list-group-item topic-entry">
                    <div class="entry media">
                        <div class="media-left media-middle">
                            <a class="list-avatar-link" href="{% url 'topic:index' %}"><img class="user-avatar" src="http://www.gravatar.com/avatar/4e5750bb485db473fc5fcaac227b78e3?s=48&amp;d="></a>
                        </div>
                        <div class="media-body media-middle">
                            <a href="{% url 'topic:index' %}" class="entry-link">
                                {{ topic.title }}
                            </a>
                            <p class="entry-meta">

                                <span class="meta">
                                    <span class="label label-info meta-top">
                                        TOP
                                    </span>
                                </span>

                                <span class="meta">
                                    <a href="/n/1/">
                                        <span class="label label-default meta-node">
                                        General
                                        </span>
                                    </a>
                                </span>
                                    <span class="meta meta-username">
                                        <a href="/u/1/">
                                            eric
                                        </a>
                                    </span>
                                    <span class="meta meta-pub_date">
                                        {{ topic.pub_time }}
                                    </span>
                                    <span class="meta meta-last_replied hidden-xs">
                                        Last Replied: 4 日 之前
                                    </span>
                            </p>
                        </div>
                        <div class="media-right media-middle">
                            <span class="badge">{{ topic.title }}</span>
                        </div>
                    </div>
                </li>
        {% endif %}

{% for topic  in  topics %}
 <li class="list-group-item topic-entry">
                    <div class="entry media">
                        <div class="media-left media-middle">
                            <a class="list-avatar-link" href="{% url 'topic:index' %}"><img class="user-avatar" src="{% static  'image/3.jpg' %}"></a>
                        </div>
                        <div class="media-body media-middle">
                            <a href="{% url 'topic:topic_content'  content_id=topic.id %}" class="entry-link">
                                {{ topic.title }}
                            </a>
                            <p class="entry-meta">

                                <span class="meta">
                                    <a href="/theme/{% all_node_theme topic.node %}/">
                                        <span class="label label-default meta-node">
                                        {{ topic.node }}
                                        </span>
                                    </a>
                                </span>
                                    <span class="meta meta-username">
                                        <a href="{% url  'user:infoprofile' username1=topic.user.username %}">
                                            <strong>{{ topic.user.username }}</strong>
                                        </a>
                                    </span>
                                    <span class="meta meta-pub_date">
                                        <strong>{{ topic.pub_time }}</strong>
                                    </span>
                                    <span class="meta meta-last_replied hidden-xs">
                                        <strong> 最新回复人：{% recent_reply topic.title %}</strong>
                                    </span>
                            </p>
                        </div>
                        <div class="media-right media-middle">
                            <a href="{% url 'topic:topic_content'  content_id=topic.id %}" class="entry-link">
                           <span class="badge">{% theme_to_reply topic.title %}</span>
                        </div>
                    </div>
                </li>

            {% endfor %}
        </ul>
        <div class="panel-footer">

    <nav>

        <ul class="pagination">
                        <li><a href="/page/1/">1</a></li>

                        <li><a href="/page/2/">2</a></li>
            <li><a href="/page/3/">3</a></li>


                <li>
                    <a href="/page/{{ page_id }}/" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>

        </ul>
    </nav>

        </div>
    </div>


	    {% endblock %}

